<%-- 
    Document   : validate
    Created on : Jun 12, 2012, 4:00:33 PM
    Author     : ciummo
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>

<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>



<script type="text/javascript" src="/DGestWebServer/SCRIPT/jquery-1.6.2.js"></script>
<script type="text/javascript" src="/DGestWebServer/SCRIPT/Ajax.js"></script>

<script type="text/javascript">
    function unValidate(idValidazione){
        var mess = window.prompt("Aggiungere messaggio di nota per l'invalidazione: "+idValidazione+"")
        window.location="Validate.do?method=unValidate&mess="+mess+"&idValidazione="+idValidazione;
        
    }
    
    
    $(document).ready(function(){
        $("#reportButton").click(function(){
            $("#report").fadeToggle("slow");
        })
    });

</script>


<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link rel="stylesheet" type="text/css" href="/DGestWebServer/css/dgest.css"/>
        <title>Validazione di Prodotto</title>
    </head>
    <body>
        
        
        <h1>Validazione prodotto con seriale <bean:write name="serialeProdotto"></bean:write></h1>
        
        <br><br>
        
        <h2>Lista check da effettuare</h2>        
        
        
        <table class="objectList">
                        <thead>
                            <tr>
                                <th>Testo</th>
                                <th>Valida</th>
                            </tr>
                        </thead>

                        <tbody>
                            
                            <logic:iterate id="validator" name="ValidCheckActionForm" property="listValidator" indexId="index" >
                                <pg:item>
                                    <tr>
                                        
                                        <logic:equal name="validator" property="valore" value="false">
                                        
                                        <td><bean:write name="validator" property="testo"></bean:write></td>
                                        <td><html:link href="Validate.do?method=validate" paramId="idValidator" paramName="validator" paramProperty="idValidazione"><img src="/DGestWebServer/images/agt_action_success.png" alt="View Order Details" height="25px" width="25px"/></html:link></td>
                                        </logic:equal>
                                    </tr>    
                                </pg:item>
                            </logic:iterate>

                        </tbody>
                    </table>
        <br><br>
        
        <h2>Lista check gia' effettuate</h2>  
         <table class="objectList">
                        <thead>
                            <tr>
                                <th>Testo</th>
                                <th>Validatore</th>
                                <th>Data</th>
                                <th>Note</th>
                                <th>Inefficia</th>
                            </tr>
                        </thead>

                        <tbody>
                            
                            <logic:iterate id="validator" name="ValidCheckActionForm" property="listValidator" indexId="index" >
                                <pg:item>
                                    <tr>
                                        
                                        <logic:equal name="validator" property="valore" value="true">
                                        
                                            <td><bean:write name="validator" property="testo"></bean:write></td>
                                            <td><bean:write name="validator" property="idUtente"></bean:write></td>
                                            <td><bean:write name="validator" property="data"/></td>
                                            <td><bean:write name="validator" property="note"/></td>
                                            <td><a href="#" onclick="unValidate('<bean:write name="validator" property="idValidazione"/>')"><img src="/DGestWebServer/images/agt_action_fail.png" alt="View Order Details" height="25px" width="25px"/></a></td>
                                            
                                        </logic:equal>
                                    </tr>    
                                </pg:item>
                            </logic:iterate>

                        </tbody>
                    </table>       
        
        <html:link href="OrderProduct.do?method=orderProductDetails" paramId="idOrderProduct" paramName="OrderProductActionForm" paramProperty="idOrdineProdotto">Ritorna alla lista prodotti ordinati</html:link>
       
        <br>
        
        <a href="#" id="reportButton">Mostra Report</a>
        <br/>
        <div id="report" style="display: none">
            <table class="center">
                
                <table class="objectList">
                        <thead>
                            <tr>
                                <th>Testo</th>
                                <th>Validatore</th>
                                <th>Data</th>
                                <th>Note</th>
                            </tr>
                        </thead>

                        <tbody>
                            
                            <logic:iterate id="validator" name="ValidCheckActionForm" property="listValidator" indexId="index" >
                                <pg:item>
                                    <tr>
                                        
                                        <logic:equal name="validator" property="valore" value="invalidate">
                                        
                                            <td><bean:write name="validator" property="testo"></bean:write></td>
                                            <td><bean:write name="validator" property="idUtente"></bean:write></td>
                                            <td><bean:write name="validator" property="data"/></td>
                                            <td><bean:write name="validator" property="note"/></td>
                                            
                                        </logic:equal>
                                    </tr>    
                                </pg:item>
                            </logic:iterate>

                        </tbody>
                </table>
                
                
                
                
            </table>
        </div>

    </body>
</html>
